package org.aileen.blog.model;


import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import org.aileen.blog.utils.DateUtils;

import java.util.Date;

@Data
public class BlogInfo {
    private Integer id;
    @NotBlank(message = " title 不能为空")
    private String title;
    @NotBlank(message = "content 不能为空")
    private String content;
    private Integer userId;
    private Integer deleteFlag;

    //当前作者是否是登录的用户
    private Boolean isLoginUser;

    private Date createTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") // 用于格式化时间
    private Date updateTime;

//    public String getUpdateTime() {
//        return DateUtils.format(updateTime);//将格式化后的时间字符串返回给前端
//    }
}
